<style scoped>
.status{
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    line-height: 30px;
}
</style>

<style>
.common-car-title{
    border-bottom:1px solid #f2f2f2;
    overflow: hidden;
    padding:10px 0;
}
.common-car-title h3{
    position: relative;
    display: inline-block;
    font-size:16px;
    padding-left:15px;
}
.common-car-title h3:before{
    content:'';
    position: absolute;
    left: 0;
    top:0;
    bottom:0;
    width:3px;
    background-color:#3db1fa;
}
.common-title-r{
    width : 250px;
    float: right;
}

</style>

<template>
    <div>
        <product-title></product-title>
        <div class="car-offer">
            <div class="common-car-title">
                <h3>投保确认</h3>
                <div class="common-title-r">
                    <Steps :current="4" size="small">
                        <Step title=""></Step>
                        <Step title=""></Step>
                        <Step title=""></Step>
                        <Step title=""></Step>
                        <Step title=""></Step>
                    </Steps>
                </div>
            </div>
            <div class="status">
                <p v-if="!status">支付中……</p>
 
                <p v-if="status"><Icon type="checkmark-circled" color="#19be6b" size="30"></Icon>支付成功！</p>
                <p v-if="status">
                    <router-link tag="a" :to="{name: 'index'}" class="">
                        如没有反应，请点击链接跳转....
                    </router-link>
                </p>
            </div>
        
        </div>
    </div>
</template>
<script>
import productTitle from '../../components/productTitle'
import { payBack } from '../../api/api'
export default {
    data () {
        return {
            status:false
        }
    },
    components: {
        productTitle
    },
    computed: {
        
    },
    mounted () {
        let bizID = this.$route.params.bizID
        let key = this.$route.params.key
        this.setStatus(bizID,key)
    },
    methods: {        
        setStatus(bizID,key){
            new Promise((resolve,reject)=>{
                let _params = {
                    bizID:bizID,
                    key:key
                }
                payBack(_params).then(res=>{
                    console.log(res)
                    if(res.data.status == 200){
                        this.status = true
                        setTimeout(()=>{
                            this.$router.push({'name':'car_order',params:{id:bizID}})
                        },1000)
                    }
                })
            })
        },

        goBack(){
            window.history.go(-1);
        },
       
    }
}
</script>
